home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tpl60n19.zip
/
README.DOC
< prev
next >
Wrap
Text File
|
1993-02-16
|
24KB
|
489 lines
Turbo-Pascal 6.0 Runtime Libary Update - Release 1.9 02-16-1993
This library is a complete replacement for the runtime library that
came with your Turbo Pascal 6.0 compiler. Due to lots of optimizations,
programs compiled with this version of TURBO.TPL will be faster.
This library maintains 99.9% compatibility with the original library.
Differences are usually due to enhancements and should not cause
any compatibility problems. Some bugs from the original library
supplied by Borland have been eliminated, but there can be no guarantee
that new ones have not crept in. If you discover any bugs, or have
other comments, please let me know. My email and snail mail addresses
are given below. Due to the nature of Borland's licensing of the
TPL source code I am not allowed to distribute the source code of
my enhanced library, so I can only provide the binary. What I am
including, starting with version 1.8, is the source for the LONGINT
and the REAL arithmetic routines. Also included for the first time in
this version is the source of most of the string routines. Since all
this code does not contain a single line of code written by Borland,
I think they can't object to the fact that I am making *my* code public.
The source for the arithmetic rouitnes is contained in the file
ARISOURC.ZIP. The source code of the string routines is contained in
file STRSOURC.ZIP. The code of the arithmetic and string routines is
hereby released into the public domain. You may use it in your own
programs under the condition that you do not include it into a
commercial product. Parties interested in commercial use of my code
should contact me at my address below.
THIS VERSION OF THE LIBRARY REPLACEMENT FOR TP 6.0 IS DEFINITELY THE
FINAL VERSION. NO FURTHER UPDATES WILL BE MADE, AS THE NEW 7.0 VERSION
OF TURBO PASCAL (AND BORLAND PASCAL) HAS BEEN INTRODUCED IN NOVEMBER
1992 AND IS NOW AVAILABLE IN LOCALIZED VERSIONS EVERYWHERE. I AM
PREPARING A SIMILAR LIBRARY FILE CALLED TPL70N10.ZIP FOR USE WITH
TP/BP 7.0.
Original library code is Copyright (C) 1983,91 Borland International
New / additional library code is Copyright (C) 1988-1993
Norbert Juffa, Wielandtstr. 14, 7500 Karlsruhe 1, Germany
Internet: S_JUFFA@IRAVCL.IRA.UKA.DE
Contents of this document:
I. Capabilities of RTL replacement
II. Revision History
III. References
I. Capabilities of RTL replacement
==================================
Improvements in SYSTEM module
-----------------------------
o REAL type software arithmetic operations now comply with ANSI/IEEE
Standard 754-1985 for Binary Floating Point Arithmetic [1,2] as much
as possible. Note that REAL arithmetic by design differs from the
standard in many ways, especially available numeric formats, value
set, and available operations. The rounding mode implemented here
is "round to nearest or even" as specified by the standard. Add,
Subtract, Multiply, Squaring, Division, and Square Root deliver
exact results with regard to this rounding mode, as demanded by the
standard. Conversions from REAL to LONGINT and from EXTENDED to REAL
use rounding to nearest or even, as specified in the standard. Correct
implementation of above features was tested with the PARANOIA test
program [3]. The correctness of basic REAL arithmetic functions has
also been tested against the coprocessor/emulator EXTENDED format
with the program FUN1_TST. The EXTENDED format carries approximately
19 decimal digits of precision.
o REAL arithmetic operations have been sped up. Speed-up for SQRT varies
between a factor of 12 for a 8086 and 29 for a Cyrix 486DLC. FRAC now
executes at nearly three times the original speed. Speed-up for SIN,
COS, ARCTAN, LN, EXP is between 50% and 100%. Division is now between
60% and 300% faster than before, depending on the CPU. Overall numeric
processing power using REAL arithmetic increases by about 51% for an
8086, by 62% for an Intel 386DX, and 80% for a Cyrix 486DLC as measured
by the WHETSTONE benchmark [4,5].
o Overall accuracy of REAL arithmetic transcendental functions has been
improved as indicated by Cody&Waite's ELEFUNT tests [6]: DLOG, DEXP,
DATAN, DSIN. Correct argument reduction ensures that relative error
over the whole argument range does not exceed 1.9e-12 for Exp, 2.8e-12
for Arctan, and 2.7e-12 for Ln. These values have been determined
by comparing the function returns of the REAL transcendental functions
to the values computed on a Cyrix 83D87 coprocessor for the EXTENDED
format. For Sin and Cos, relative error is also in the above range
when the argument is reasonably small (e.g. in range -100..100) and
not very close to an integer multiple of 0.25*Pi. The error of the
transcendental functions expressed in ULPs (units in the last place)
over the whole argument range does not exceed 1.6 ULPs for Exp, 1.8
ULPs for Arctan, and 2.2 ULPs for Ln. These values were determined
using the ULPERR program.
o Execution of coprocessor floating point computations using an 80287 or
80387 has been accelerated. For these coprocessors, NOPs will be inserted
before every floating point instruction converted from an emulator
interrupt instead of WAITs. As a result of this optimization, an
improvement in execution speed of 15% has been observed running the
Lawrence Livermore Loops (LLL) [7] on a Cyrix 83D87, the improvement
for the WHETSTONE benchmark on the 83D87 is 9.4%. Maximum performance
gain for tight loops (e.g. fractal computation) by this measure is about
22%.
o On 80287XL, 80387, 80486DX or compatible chips the Sin and Cos functions
take advantage of the FSIN and FCOS instructions of these coprocessors,
speeding up these functions by almost a factor of two. As a side effect,
there is also some improvement in accuracy as measured by the DSIN test
program from the ELEFUNT test suite. Also, the Arctan function takes
advantage of the increased argument range of the FPATAN function. These
optimizations result in another 19% increase in WHETSTONE power, so
that the total combined speedup over the original library is 25%
for this benchmark when run on a 387 compatible coprocessor.
o STRING operations are faster, especially for longer strings. Most
dramatic increase is in the INSERT function, with execution times
reduced to up to one fourth compared with the original version of
the RTL. Faster string operations cause 7% performance increase for
the DHRYSTONE [8,9] benchmark on a 8086.
o Improved speed of random number generation. Random for REAL numbers
is 10-20% faster, Random for EXTENDED numbers is 5% faster. Due to
the improvements in the uniform distribution of integer random numbers,
there is a decrease in the speed of integer random number generation
of about 5%.
o Binary to decimal conversions used in Str and Write procedures have
been sped up by up to 70% for integers (BYTE, SHORTINT, INTEGER,
WORD, LONGINT), up to 5% for REAL numbers and about 3% for EXTENDED
numbers.
o Improved speed of LONGINT arithmetic. Division enjoys fourfold reduction
of execution time on 8086, for an Intel RapidCAD CPU the speed up factor
is 5.2 and for a Cyrix 486DLC the speed-up factor is 10.1.
o Several of the functions of the heap manager have been tuned, resulting
in 6%-18% faster operation for these routines, depending on the CPU used.
o Set functions have been sped up by a few percent, but the add variable
range operation may be up to eight times as fast.
o UPCASE function has been enhanced to support the complete IBM c